package com.example.inject.springinject;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class HelloController {
    @Resource
    HelloService helloService;

    @GetMapping("service")
    public String hello() {
        return helloService.hello();
    }

    @GetMapping("new")
    public String newHello() {
        Person person = new Person();
        return person.hello();
    }
}
